@*
* Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0
* See accompanying LICENSE file.
*@
@import kafka.manager.model.ActorModel.BrokerIdentity
@(cluster:String, brokerListExtended: kafka.manager.BrokerListExtended)(implicit messages: play.api.i18n.Messages, request:RequestHeader)

            <table class="table">
                <thead>
                <tr>
                    <td>Id</td>
                    <td>Host</td>
                    <td>Port</td>
                    <td>JMX Port</td>
                    <td>Bytes In</td>
                    <td>Bytes Out</td>
                    @if(brokerListExtended.clusterContext.config.jmxEnabled && brokerListExtended.clusterContext.config.displaySizeEnabled) {
                    <td>Size</td>
                    }
                </tr>
                </thead>
                <tbody>
                @for(broker <- brokerListExtended.list) {
                <tr>
                    <td><a href="@routes.Cluster.broker(cluster,broker.id.toInt).relative">@broker.id</a></td>
                    <td>@broker.host</td>
                    <td>@broker.endpointsString</td>
                    <td>@broker.jmxPort</td>
                    <td>
                        <span class="badge">
                            @brokerListExtended.metrics.get(broker.id).map(_.bytesInPerSec.formatOneMinuteRate)
                        </span>
                    </td>
                    <td>
                        <span class="badge">
                            @brokerListExtended.metrics.get(broker.id).map(_.bytesOutPerSec.formatOneMinuteRate)
                        </span>
                    </td>
                    @if(brokerListExtended.clusterContext.config.jmxEnabled && brokerListExtended.clusterContext.config.displaySizeEnabled) {
                    <td>
                        <span class="badge">
                            @brokerListExtended.metrics.get(broker.id).map(_.size.formatSize)
                        </span>
                    </td>
                    }
                </tr>
                }
                </tbody>
            </table>

